public class Demo1_1 {
    //编写程序数一下1到100的所有整数中出现多少个数字9
    public static void main(String[] args) {
        int i = 0;
        int count = 0;
        for (i = 1; i <= 100; i++) {
            if (i % 10 == 9) {
                count++;
            }
            if (i / 10 == 9) {
                count++;
            }
        }
        int sum = count;
        System.out.println(sum);
    }
}
